package com.njwb.config;

import com.njwb.pojo.Person;
import com.njwb.pojo.Phone;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import java.util.Date;

@Configuration
public class SpringConfig {
    @Bean("beanDate")
    public Date date(){
        return new Date();
    }

    @Bean
    public Phone phone(){
        return new Phone();
    }

    @Bean
    public Person person(Phone phone){
        Person person = new Person();
        person.setPhone(phone);
        return person;
    }

}
